﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="SettingUser.aspx.cs" Inherits="MLM.AdminCP.Pages.SettingUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    User Setting
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <%-- <telerik:RadAjaxLoadingPanel runat="server" ID="gridLoadingPanel">
    </telerik:RadAjaxLoadingPanel>--%>
    <telerik:RadGrid ID="RadEditUserSettingGrid" runat="server" AllowFilteringByColumn="True"
        DataSourceID="GroupUserSettingEds" AllowPaging="True" AllowSorting="True" GridLines="None"
        ShowGroupPanel="True"  AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
        AllowAutomaticDeletes="True" ShowFooter="True" ShowStatusBar="True" OnItemDataBound="OnItemDataBoundHandler"
        OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid2_InserCommad">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="UserId" DataSourceID="GroupUserSettingEds"
            ShowHeader="true" ShowHeadersWhenNoRecords="true" AllowAutomaticInserts="true"
            CommandItemDisplay="TopAndBottom" EditMode="PopUp">
            <%--<MasterTableView ShowFooter="false" DataKeyNames="ProductID" EditMode="InPlace" CommandItemDisplay="TopAndBottom">--%>
            <CommandItemSettings ShowAddNewRecordButton="true" ShowRefreshButton="true">
                <%--ExportToPdfText="Export to Pdf">--%></CommandItemSettings>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="UserId" DataType="System.Int64" HeaderText="UserId"
                    ReadOnly="True" SortExpression="UserId" UniqueName="UserId">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Password" HeaderText="Password" SortExpression="Password"
                    UniqueName="Password">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName"
                    UniqueName="FirstName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="LastName" HeaderText="LastName" SortExpression="LastName"
                    UniqueName="LastName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address"
                    UniqueName="Address">
                </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Country.Name" HeaderText="Country" SortExpression="CountryID"
                    UniqueName="CountryID" meta:resourcekey="GridBoundColumnResource455" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CityName" HeaderText="City" SortExpression="CityName"
                    UniqueName="CityName" meta:resourcekey="GridBoundColumnResource4554">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="RegistrationDate" DataType="System.DateTime"
                    HeaderText="RegistrationDate" SortExpression="RegistrationDate" UniqueName="RegistrationDate">
                </telerik:GridBoundColumn>
                <%--<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
                </telerik:GridEditCommandColumn>--%>
                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                </telerik:GridEditCommandColumn>
                <telerik:GridButtonColumn ConfirmText="Delete?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings EditFormType="Template" InsertCaption="Add new item" CaptionFormatString="Edit User: {0}"
                CaptionDataField="FirstName" PopUpSettings-Modal="true" FormTableStyle-Width="600px">
                <FormTemplate>
                    <table id="Table2" style="border-collapse: collapse; padding-left: 20px; width: 650px">
                        <tr class="EditFormHeader">
                            <td style="font-size: small" colspan="2">
                                <b>
                                    <asp:Label ID="Label1" runat="server" Text="User Setting"></asp:Label></b>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="tableTitle">
                                <asp:Label ID="Label2" runat="server" Text="UserId:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox7" runat="server" Text='<%# Eval("UserId") %>' Enabled="False">
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="tableTitle">
                                <asp:Label ID="lbFirstName" runat="server" Text="FirstName:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox1" runat="server" Text='<%# Bind("FirstName") %>'>
                                </telerik:RadTextBox>
                            </td>
                            <td class="tableTitle">
                                <asp:Label ID="lbLastName" runat="server" Text="LastName:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox2" runat="server" Text='<%# Bind("LastName") %>'>
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="tableTitle">
                                <asp:Label ID="lbCountry" runat="server" Text="Country:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox runat="server" ID="RadCountryID" DataTextField="Name" DataValueField="CountryID"
                                    DataSourceID="GroupCountryEds" AutoPostBack="true" EnableLoadOnDemand="true"
                                    OnSelectedIndexChanged="RadComboBox2_SelectedIndexChanged" SelectedValue='<%#Bind("CountryID") %>'>
                                </telerik:RadComboBox>
                            </td>
                            <td class="tableTitle">
                                <asp:Label ID="lbCityID" runat="server" Text="City:"></asp:Label>
                            </td>
                            <td>
                                <%--<telerik:RadComboBox ID="cbCitis" runat="server" DataSourceID="GroupCitiesEds" OnItemDataBound="rcbCity_ItemDataBound"
                                    DataTextField="Name" DataValueField="CityID" OnSelectedIndexChanged="rcbCity_SelectedIndexChanged">
                                    <HeaderTemplate>
                                        <ul>
                                            <li style="list-style-type: none" class="col1">
                                                <asp:Label ID="citydetail" runat="server" Text="Cities"></asp:Label></li>
                                        </ul>
                                    </HeaderTemplate>
                                </telerik:RadComboBox>--%>
                                 <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox8" runat="server" Text='<%# Bind("CityName") %>'>
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="tableTitle">
                                <asp:Label ID="lbSponsorID" runat="server" Text="SponsorID:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox3" runat="server" Text='<%# Bind("SponsorID") %>'>
                                </telerik:RadTextBox>
                            </td>
                            <td class="tableTitle">
                                <asp:Label ID="lbRoleID" runat="server" Text="RoleID:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox runat="server" ID="radcombobox1" DataTextField="Name" DataValueField="RoleID"
                                    DataSourceID="RoleEds" EnableLoadOnDemand="true" SelectedValue='<%#Bind("RoleID") %>'>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="tableTitle">
                                <asp:Label ID="lbAddress" runat="server" Text="Address:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox4" runat="server" Text='<%# Bind("Address") %>'>
                                </telerik:RadTextBox>
                            </td>
                            <td class="tableTitle">
                                <asp:Label ID="lbPostalCode" runat="server" Text="PostalCode:"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox5" runat="server" Text='<%# Bind("PostalCode") %>'>
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="tableTitle">
                                <asp:Label ID="lbPassword" runat="server" Text="Password:"></asp:Label>
                            </td>
                            <td style="width: 50px">
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox6" runat="server" Text='<%# Bind("Password") %>'>
                                </telerik:RadTextBox>
                            </td>
                            <td class="tableTitle">
                                <asp:Label ID="lbRegistrationDate" runat="server" Text="RegistrationDate:"></asp:Label>
                            </td>
                            <td style="width: 50px">
                                <telerik:RadDatePicker ID="RadDatePicker1" runat="server" MinDate="1/1/1900" TabIndex="4"
                                    DbSelectedDate='<%# Bind( "RegistrationDate") %>'>
                                </telerik:RadDatePicker>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="Label3" runat="server" Text="TaxID:"></asp:Label></td>
                            <td><telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox9" runat="server" Text='<%# Bind("TaxID") %>'></telerik:RadTextBox></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td style="padding-bottom: 10; padding-top: 10px">
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                </asp:Button>
                            </td>
                            <td style="padding-bottom: 10; padding-top: 10px">
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    CommandName="Cancel"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Office2007">
        </HeaderContextMenu>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="GroupCountryEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableFlattening="False" EntitySetName="Countries"
        EntityTypeFilter="Country">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="GroupUserSettingEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="Users" Include="City,Country" >
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="RoleEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EntitySetName="Roles" EntityTypeFilter="Role" OrderBy="it.RoleID desc">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="GroupCitiesEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableFlattening="False" EntitySetName="Cities"
        Select="it.[CountryID], it.[CityID], it.[Name]">
    </asp:EntityDataSource>
</asp:Content>
